<?php

abstract class Kd_Html_Grid_Cell_Text extends Kd_Html_Grid_Cell_Base {

	private $_text = '';
	private $_emptyText = '';

	protected function __construct() {
		parent::__construct();
	}

	public function getEmptyText() {
		return $this->_emptyText;
	}
	public function setEmptyText($value) {
		$this->_emptyText = $value;
		return $this;
	}

	public function getText() {
		return $this->_text;
	}
	public function setText($value) {
		$this->_text = $value;
		return $this;
	}

	public function getCellText() {
		$result = Kd_Util_String::format($this->getText(), $this->getGrid()->getCurrentRow());
		if (is_null($result) || strlen($result) == 0) {
			$result = $this->getEmptyText();
		}
		return $result;
	}
}